Skip to content

Include all coefficients in ExponentialSplinesFitting when kappa is fixed - #3056

Open
RAJ-A58 wants to merge 1 commit into
lballabio:masterfrom
RAJ-A58:fix/exponential-splines-fixed-kappa
Open

RAJ-A58 wants to merge 1 commit into
lballabio:masterfrom
RAJ-A58:fix/exponential-splines-fixed-kappa

Conversation

@RAJ-A58

@RAJ-A58 RAJ-A58 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #3046.

Summary of Changes

When fixedKappa is specified in ExponentialSplinesFitting, the parameter array x contains only the spline coefficients and does not include $\kappa$ at the end.

In ExponentialSplinesFitting::discountFunction(), size() returns the number of optimization parameters in x. Stopping the loop at N - 1 inadvertently dropped the last coefficient in both the unconstrained and constrained cases.

  • Evaluates all N coefficients in discountFunction() when fixedKappa is set.
  • Added regression test testExponentialSplinesFixedKappa in test-suite/fittedbonddiscountcurve.cpp covering constrained and unconstrained variants and verifying sensitivity to the last coefficient.

…ixed

When fixedKappa is specified, the parameter array x only contains the spline coefficients and not kappa. In discountFunction(), size() returns the number of parameters in x, so looping up to N - 1 was dropping the last coefficient.

Fixes lballabio#3046.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ExponentialSplinesFitting ignores the last coefficient when kappa is fixed

1 participant